<template>
  <el-card class="box-card" style="width: 1180px">   
    <div slot="header" class="clearfix">
      <el-form :inline="true" :model="query">
        <el-form-item>
          <el-button type="success"
            >打款详情</el-button
          >     
        </el-form-item>
      </el-form>
    </div>      
    <el-table :data="repList" border style="width: 100%">
        <el-table-column prop="heTongId" label="合同号" >
</el-table-column>
      <el-table-column prop="name" label="姓名" >
      </el-table-column>
      <el-table-column prop="sumExpirse" label="总期数" width="160">
      </el-table-column>
      <el-table-column prop="nowExpirse" label="当前期数" width="160">
      </el-table-column>
      <el-table-column prop="prepaymentPeriods" label="还款期数"></el-table-column>
      <el-table-column prop="currentSum" label="还款金额">
      </el-table-column>
      <el-table-column prop="currentInterest" label="还款利息">
      </el-table-column>
      
      <el-table-column label="操作" width="220">
        <template slot-scope="scope">
          <el-button size="mini" @click="edit(scope.row.heTongId)"
            >通过</el-button
          >

        </template>
      </el-table-column>      
    </el-table>
  </el-card>
</template>

<script>
export default {
  data() {
    return {
        repList:[],
      query:{
      },
      addForm:{},
      updateForm:{},
    };
  },
  methods: {
    edit(id){
        this.$axios.get("/repays/sel/"+id)
        .then(res=>{
            if(res.data.code==200){
                this.$message.success("汇款成功");
                this.loadRes();
            }else{
                this.$message.error("本公司账户余额不足")
            }
        })
    },
    loadRes(){
        this.$axios.post("/repays/all")
        .then(res=>{
                this.repList=res.data.data.list;
        })
    },
  },
  mounted(){
    this.loadRes();
  }
};
</script>